package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.MessageRecordMapper;
import com.ruoyi.gybj.domain.MessageRecord;
import com.ruoyi.gybj.service.IMessageRecordService;

/**
 * 消息推送记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class MessageRecordServiceImpl implements IMessageRecordService 
{
    @Autowired
    private MessageRecordMapper messageRecordMapper;

    /**
     * 查询消息推送记录
     * 
     * @param id 消息推送记录主键
     * @return 消息推送记录
     */
    @Override
    public MessageRecord selectMessageRecordById(Long id)
    {
        return messageRecordMapper.selectMessageRecordById(id);
    }

    /**
     * 查询消息推送记录列表
     * 
     * @param messageRecord 消息推送记录
     * @return 消息推送记录
     */
    @Override
    public List<MessageRecord> selectMessageRecordList(MessageRecord messageRecord)
    {
        return messageRecordMapper.selectMessageRecordList(messageRecord);
    }

    /**
     * 新增消息推送记录
     * 
     * @param messageRecord 消息推送记录
     * @return 结果
     */
    @Override
    public int insertMessageRecord(MessageRecord messageRecord)
    {
        messageRecord.setCreateTime(DateUtils.getNowDate());
        return messageRecordMapper.insertMessageRecord(messageRecord);
    }

    /**
     * 修改消息推送记录
     * 
     * @param messageRecord 消息推送记录
     * @return 结果
     */
    @Override
    public int updateMessageRecord(MessageRecord messageRecord)
    {
        messageRecord.setUpdateTime(DateUtils.getNowDate());
        return messageRecordMapper.updateMessageRecord(messageRecord);
    }

    /**
     * 批量删除消息推送记录
     * 
     * @param ids 需要删除的消息推送记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageRecordByIds(Long[] ids)
    {
        return messageRecordMapper.deleteMessageRecordByIds(ids);
    }

    /**
     * 删除消息推送记录信息
     * 
     * @param id 消息推送记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageRecordById(Long id)
    {
        return messageRecordMapper.deleteMessageRecordById(id);
    }
}
